package com.ileaf.media;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

/**
 * @author Lianlb
 * @since 2019-11-07 15:33
 */
public class Pc {


    public static void main(String[] args) throws ParseException {
//        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//        format.setTimeZone(TimeZone.getTimeZone("GMT+08"));
//        TimeZone timeZone = format.getTimeZone();
//        Date date = format.parse("1988-05-01 00:00:00");
//        System.out.println("默认时区 " + timeZone.getID());
//        System.out.println("是否夏令时 " + timeZone.getDSTSavings());
//        System.out.println(date);

        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        TimeZone timeZone = format.getTimeZone();
        Date date = format.parse("1987-06-01 00:00:00");
        System.out.println(date);
        System.out.println("默认时区 " + timeZone.getID());
        System.out.println("-------------------");
        format.setTimeZone(TimeZone.getTimeZone("GMT+08"));
        System.out.println(format.getTimeZone().getID());
        Date date1 = format.parse("1987-06-01 00:00:00");
        System.err.println(date1);
        System.out.println(date1.getTime() - date.getTime());

    }
}
